# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pygoogle-simple
pkgname=('python2-pygoogle-simple' 'python-pygoogle-simple')
_pkgname=pygoogle-simple
pkgver=0.2.3
pkgrel=10
pkgdesc='Search in google by AJAX Google API.'
arch=('any')
url='https://pypi.python.org/pypi/pygoogle-simple/'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.zip")
sha512sums=('af4d4630102ee7e1be9f8b1ba6488f0b98825f3d18e4d34bc7de735125aca0fd56374185e2500f14d85319bdf173aa55d8e20aa6f031f2cbacffc0c87c1612ad')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pygoogle-simple() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-pygoogle-simple() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

